{% extends "base.html" %}

{% block content %}
  <h1 class="mt-5">Edit Note</h1>
  <form method="POST">
    <div class="form-group">
      <label for="title">Title</label>
      <input type="text" class="form-control" id="title" name="title" value="{{ note.title }}" required>
    </div>
    <div class="form-group">
      <label for="category">Category</label>
      <select class="form-control" id="category" name="category" required>
        <option value="Work" {% if note.category == 'Work' %}selected{% endif %}>Work</option>
        <option value="Personal" {% if note.category == 'Personal' %}selected{% endif %}>Personal</option>
        <option value="Meeting" {% if note.category == 'Meeting' %}selected{% endif %}>Meeting</option>
        <option value="Other" {% if note.category == 'Other' %}selected{% endif %}>Other</option>
      </select>
    </div>
    <div class="form-group">
      <label for="content">Content</label>
      <textarea class="form-control" id="content" name="content" rows="10" required>{{ note.content }}</textarea>
    </div>
    <div class="form-group">
      <label for="tags">Tags</label>
      <input type="text" class="form-control" id="tags" name="tags" value="{{ note.tags }}">
    </div>
    <button type="submit" class="btn btn-primary">Save</button>
  </form>
{% endblock %}
